using System;

namespace TicTacToe.Core
{
    public sealed class GameOverEventArgs : EventArgs
    {
        public Player WinningPlayer { get; private set; }
        public Player LosingPlayer { get; private set; }

        private readonly int[] mWinningCoords;
        public int[] GetWinningCoordinates()
        {
            return mWinningCoords;
        }

        public bool IsDraw { get; private set; }
         
        public GameOverEventArgs(Player winningPlayer, Player losingPlayer, params int[] winningCoords)
        {
            if (winningCoords.Length != 12)
                throw new ArgumentException("Length of winningCoords must be 12", "winningCoords");

            IsDraw = false;
            WinningPlayer = winningPlayer;
            LosingPlayer = losingPlayer;
            mWinningCoords = winningCoords;
        }

        public GameOverEventArgs()
        {
            IsDraw = true;
        }
    }
}